<extend name="Public/base"/>
<block name="body">
  <div class="Tool_Bar" id="Config_Bar">
    <dl>
      <dt>配置管理</dt>
      {$Main_Nav}
    </dl>
  </div>
  <div style="display: none">
    <form id="Config_Search_From" >
      <fieldset class="Form_1 Form_2">
        <div class="formitm">
          <label class="lab" for="for_name">配置名称 ：</label>
          <div class="ipt">
            <input name="s_name"  id="for_name"type="text" class="easyui-textbox" style="height:30px;">
          </div>
        </div>
        <div class="formitm">
          <label class="lab" for="for_type">配置类型 ：</label>
          <div class="ipt">
            <select name="s_type" id="for_s_type" class="easyui-combobox" style="height:30px;" data-options="url:'{:U("Admin/Function/get_config")}&cname=CONFIG_TYPE_LIST&r_type=json',valueField:'id',textField:'text',value:null">
            </select>
          </div>
        </div>
        <div class="formitm">
          <label class="lab" for="for_title">配置标题 ：</label>
          <div class="ipt">
            <input name="s_title"  id="for_title"type="text" class="easyui-textbox" style="height:30px;">
          </div>
        </div>
        <div class="formitm">
          <label class="lab" for="for_group">配置分组 ：</label>
          <div class="ipt">
            <select name="s_group" id="for_s_group" class="easyui-combobox" style="height:30px;" data-options="url:'{:U("Admin/Function/get_config")}&cname=CONFIG_GROUP_LIST&r_type=json',valueField:'id',textField:'text',value:null">
            </select>
          </div>
        </div>
        <div class="formitm">
          <label class="lab" for="for_create_time">创建时间 ：</label>
          <div class="ipt">
            <input name="s_create_time_min" type="text" class="easyui-datebox" style="height:30px;">
            -
            <input name="s_create_time_max" type="text" class="easyui-datebox" style="height:30px;">
          </div>
        </div>
        <div class="formitm">
          <label class="lab" for="for_update_time">更新时间 ：</label>
          <div class="ipt">
            <input name="s_update_time_min" type="text" class="easyui-datebox" style="height:30px;">
            -
            <input name="s_update_time_max" type="text" class="easyui-datebox" style="height:30px;">
          </div>
        </div>
        <div class="formitm">
          <label class="lab" for="for_status">状态 ：</label>
          <div class="ipt">
            <select name="s_status" id="for_s_status" class="easyui-combobox" style="height:30px;" data-options="url:'{:U("Admin/Function/get_field_option")}&f_id=27&r_type=json',valueField:'id',textField:'text',value:null">
            </select>
          </div>
        </div>
      </fieldset>
    </form>
  </div>
  <table id="Config_Data_List">
  </table>
  <script charset="utf-8" src="{:U('Admin/Function/get_config',array('r_name'=>'type'))}&cname=CONFIG_TYPE_LIST&r_type=json_list"></script> 
  <script charset="utf-8" src="{:U('Admin/Function/get_config',array('r_name'=>'group'))}&cname=CONFIG_GROUP_LIST&r_type=json_list"></script> 
  <script charset="utf-8" src="{:U('Admin/Function/get_field_option',array('f_id'=>'27','r_type'=>'json_list'))}"></script> 
  <script type="text/javascript">
$(function() {
	$("#Config_Data_List").datagrid({
		url : "{:U('Config/index')}",
		fit : true,
		striped : true,
		border : false,
		pagination : true,
		pageSize : 20,
		pageList : [ 10, 20, 50 ],
		pageNumber : 1,
		sortName : 'id',
		sortOrder : 'desc',
		toolbar : '#Config_Bar',
		singleSelect : true,
		frozenColumns:[[
			{field : 'id',title : 'ID',width : 40,sortable:true}
,
			{field : "name",title : "配置名称",width :160}
			,
			{field : "title",title : "配置标题",width :160}
				
		]],
		columns : [[

			{field : "type",title : "配置类型",width :60,formatter: function (value, row, index) {
					return op_type[value];
			}},
			
			{field : "group",title : "配置分组",width :60,formatter: function (value, row, index) {
					return op_group[value];
			}},
			
			{field : "create_time",title : "创建时间",width :80,formatter: function (value, row, index) {
				return u_to_ymd(value)
			}},
			
			{field : "update_time",title : "更新时间",width :80,formatter: function (value, row, index) {
				return u_to_ymd(value)
			}},
			
			{field : "status",title : "状态",width :50,formatter: function (value, row, index) {
					return op_status[value];
			}},
			
			{field : "sort",title : "排序",width :50},
				

			{field : "operate",title : "操作",width : 200,formatter: function (value, row, index) {
				operate_menu='';
				
				<if condition="Is_Auth('Admin/Config/edit')">
				operate_menu = operate_menu+"<a href='<?php echo U('edit'); ?>&id="+row.id+"' >编辑</a>";
				</if>

				<if condition="Is_Auth('Admin/Config/del')">
				operate_menu = operate_menu+" | <a href='#' onclick=\"Data_Ajax('<?php echo U('del'); ?>&id="+row.id+"','Config_Data_List');\">删除</a>";
				</if>

				return operate_menu;
			}}
		]]
	});
})
<!-- 扩展数据 starp-->
<!-- 扩展数据 end-->
</script></block>
